<!DOCTYPE html>
<html>
	<head>
	    <meta charset="utf-8">
	    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
	    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
	    <title>Hello APP</title>
	    <link rel="stylesheet" type="text/css" href="../../css/index.css" />
	</head>
	<style type="text/css">
		html,body{width: 100%;height:100%;overflow: hidden;overflow-y: scroll;-webkit-overflow-scrolling: touch;touch-action: none;}

		.itemWipe{ background:#f6f6f6; position:relative;-webkit-transform: translateX(0px);height: 100px;background-color: #ffffff;}
		.itemWipe .item-delete{position:absolute;top:0;right:-90px;background:#FF9502;font-size:12px;color:#fff;width:90px;height:100%;text-align:center;display:inline-block;z-index:10;display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;}
		.itemWipe .item-delete:before{content:'取消收藏';color:#fff;}
		.itemWipe .item-wipe{ height: 100%;}

		/*会员秒杀*/
		.shoucang-box{width: 100%;background: #FFFFFF;}
		.shoucang-box .shoucang-one{width: 100%;height: 100px;padding: 10px 15px;box-sizing: border-box;position: relative;}
		.shoucang-box .shoucang-one .img-box{width: 80px;height: 80px;flex-shrink: 0;overflow: hidden;}
		.shoucang-box .shoucang-one .img-box img{width: 100%;display:block;}
		.shoucang-box .shoucang-one .info-box2{padding-left: 16px;box-sizing: border-box;}
		.shoucang-box .shoucang-one .info-box2 .name{width: 100%;font-size: 15px;color: #333333;height: 42px;}
		.shoucang-box .shoucang-one .info-box2 .num-box{font-size: 12px;color: #8E9194;padding-top: 2px;box-sizing: border-box;}
		.shoucang-box .shoucang-one .info-box2 .price-box{width: 100%;padding-top: 16px;box-sizing: border-box;align-items: center;}
		.shoucang-box .shoucang-one .info-box2 .price-box .p1-box{width: auto;margin-right: 10px;align-items: center;}
		.shoucang-box .shoucang-one .info-box2 .price-box .p1-box .p1-img{width: 14px;height: 14px;}
		.shoucang-box .shoucang-one .info-box2 .price-box .p1-box .p1{font-size: 14px;color: #FF9502;font-weight:500;padding-left: 4px;box-sizing: border-box;margin-top:1px;}
		.shoucang-box .shoucang-one .info-box2 .price-box .p2-box{width: auto;align-items: center;}
		.shoucang-box .shoucang-one .info-box2 .price-box .p2-box .p2-img{width: 12px;height: 12px;}
		.shoucang-box .shoucang-one .info-box2 .price-box .p2-box .p2{font-size: 12px;color: #666666;padding-left: 4px;box-sizing: border-box;}
		.shoucang-box .shoucang-one .info-box2 .price-box .p3-box{font-size: 12px;color: #8E9194;text-decoration: line-through;padding-left: 4px;box-sizing: border-box;}
		.shoucang-box .itemWipe:nth-child(1) .item-wipe .shoucang-one::before{display: none;}

	</style>
	<body>
		<div id="vue" class="warp">

			<div class="shoucang-info" style="display:none;" :style="{ display:(Pdata ? '':'none')}">
				<div class="shoucang-box">
					<div class="itemWipe" v-for="(item,key) in Pdata.listData">
						<div class="item-wipe flex" :data-id="item.sid" :data-type="item.htype" tapmode onclick="open_goods(this)">
							<div class="shoucang-one border-top flex">
								<div class="img-box" >
									<img :src="item.image"/>
								</div>
								<div class="info-box2">
									<div class="name han_2" v-text="item.title"></div>
									<div class="price-box flex">
										<div class="p1-box flex">
			                                <div class="p1" v-text="'¥'+item.price"></div>
			                            </div>
			                            <div class="p3-box" v-if="item.price_del && !item.vipprice" v-text="'¥' + item.price_del"></div>
									</div>
								</div>
							</div>
						</div>
						<div class="item-delete" :data-id="item.sid" tapmode onclick="delThis(this);"></div>
					</div>
				</div>
			</div>

			<!--占位图-->
			<div class="nodata" style="display:none;" :style="{ display:(noData ? '':'none')}">
				<img src="../../image/no_page/no_shoucang.png" />
				<p>暂无收藏商品</p>
			</div>

			<!-- 底部 -->
			<div class="bottom-box" :style="{ display:(loadingMsg ? '':'none')}">
				<div class="msgbox" v-html="loadingMsg" style="color:#999;"></div>
			</div>

		</div>
	</body>
</html>
<script type="text/javascript" src="../../script/base.min.js" id="loadjs" data-js="L/lazyload,L/zepto.touchWipe"></script>
<script type="text/javascript">

	define(function (require, exports, module) {

		_page.getData = function(loading) {
			lanYun.getVueData({url:'user/shoucang',get:{},cache:0,loading:loading},function(ret) {
				//console.log(JSON.stringify(ret));
				$('.itemWipe').touchWipe({itemDelete: '.item-delete'});
			});
		};

		lanYun.newVue('#vue',{
			startX : 0 ,
  			endX : 0 ,
		},function() {
			_page.getData(2);
		});

		//滚动加载..
		new auiScroll({distance:200, listen:true},function(ret) {
			if($(window).scrollTop() < 2) ret.isToBottom = false;
			var d = ret.scrollTop / 208;
			if(!ret.isToBottom) return;
			_page.getData(0);
		});

		//打开商品详情
		open_goods = function (tis) {
	        var dst = tis.dataset;
	        lanYun.openWin('goods/show', {
	            win:'none',
	            frameParam : dst,
	        });
	    }

		//取消收藏
		delThis = function(tis){
			var dst = tis.dataset;
			lanYun.get('User/addsc?sid=' + dst.id ,function (ret){
				lanYun.toast(ret.msg);
				lanYun.ajaxPageSta = 0; lanYun.page = 1;
				_page.getData(1);
			})
		}

	});

</script>
